package collection;

import java.util.ArrayList;
import java.util.List;

public class SublistDemo {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add(i*10);
        }
        System.out.println(list);

        List<Integer> list1 = list.subList(3,6);
        System.out.println(list1);

        for (int i = 0; i < list1.size(); i++) {
            list1.set(i,list1.get(i)*10);
        }
        System.out.println(list1);
        System.out.println(list);

        list.set(3,1000);
        System.out.println(list1);
        System.out.println(list);

        list1.remove(0);
        System.out.println(list1);
        System.out.println(list);

    }
}
